public class CasesClose
{

    public string CaseNumber{get;set;}
    public string Subject{get;set;}
    public string Status{get;set;}
    public string Notes{get;set;}
    public Datetime NextCall {get;set;}
    
    
    
   Case caseclose=new Case();
   
    //Constructor 
    public CasesClose()
    {
       ID id = ApexPages.currentPage().getParameters().get('id');
       //Query to get Cases list for a specific Account
       caseclose=[SELECT Id,CaseNumber,Subject,Status,Description,Notes__c,Next_Call__c FROM Case WHERE Id = :id ];
    }
    
    //Method returns cases list to visualforce page
    public Case getCasesClose()
    {
        return caseclose;
    }
    
    public pageReference save()
    {
       if(Status!='Closed' )
             caseclose.addError('Next call cannot be empty when status is not closed');
       //else
       //      upsert caseclose;
       return null;
  
    }
    public PageReference cancel() {
        return null;
    }

    
    /*public PageReference save()
    {
    PageReference pg=new PageReference('');
    return pg;
    }
    */
}